from tkinter import *

root=Tk()

def callback():
    print('1')

mb1=Menubutton(root,text='点我',relief=RAISED)
mb1.pack()

fillmenubar1=Menu(mb1,tearoff=False)
fillmenubar1.add_command(label='保存',command=callback)
fillmenubar1.add_checkbutton(label='打开',command=callback)
fillmenubar1.add_separator()
fillmenubar1.add_command(label='退出',command=root.quit)
mb1.config(menu=fillmenubar1)

list1=[('open',1),('save',2),('quit',3)]
mb2=Menubutton(root,text='点他',relief=RAISED)
mb2.pack()
editvar=IntVar()
fillmenubar2=Menu(mb2,tearoff=False)
for i,j in list1:
    fillmenubar2.add_radiobutton(label=i,variable=editvar,value=j)

mb2.config(menu=fillmenubar2)

mainloop()
